/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.classic.Session;
import pojo.User;
import until.HibernateUtil;


/**
 *
 * @author Admin
 */
public class userDAO {
    public static List<User> LayTatCaUser(){
       List<User>ds=null;
       Session sc = HibernateUtil.getSessionFactory().openSession();
        try {
            String sql="from User";
            Query query = sc.createQuery(sql);
            ds = query.list();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
       finally{
            sc.close();
        }
        return ds;
    }
    
}
